/*
 * Main.cpp
 *
 *  Created on: Sep 24, 2011
 *      Author: nowak4
 */

#include "webcrawler.h"
#include <stdio.h>
#include <stdlib.h>

#define MAXURL 10

void usage();

int main(int argc, char ** argv) {
	char ** url;
	if (argc == 1) {
		url = (char**)malloc(sizeof(char*));
		url[0] = strdup("http://cs.purdue.edu");
	}
	else {
		url = (char**)malloc(sizeof(char*)*argc-1);
		for (int idx = 0; idx < argc-1; idx++)
			url[idx] = strdup(argv[idx+1]);
	}
	WebCrawler *crawl = new WebCrawler(MAXURL, argc-1, (const char**) url);
	crawl->crawl();
}

void usage() {
	printf("WebCrawler <url root>\n");
}
